package com.lanhai.crowd.mapper;

import com.lanhai.crowd.entity.Auth;
import com.lanhai.crowd.entity.AuthExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;

public interface AuthMapper {
    long countByExample(AuthExample example);

    int deleteByExample(AuthExample example);

    int deleteByPrimaryKey(Integer id);

    int insert(Auth record);

    int insertSelective(Auth record);

    List<Auth> selectByExample(AuthExample example);

    Auth selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param("record") Auth record, @Param("example") AuthExample example);

    int updateByExample(@Param("record") Auth record, @Param("example") AuthExample example);

    int updateByPrimaryKeySelective(Auth record);

    int updateByPrimaryKey(Auth record);

    List<Integer> selectAssignedAuthByRoleId(@Param("roleId")Integer roleId); // 查询已分配给该角色的权限

    void deleteAssignedAuthRelationshipByRoleId(@Param("roleId") Integer roleId); // 根据roleId删除相关权限信息

    void insertAuthRelationshipByAuthIds(@Param("roleId") Integer roleId, @Param("authIdArray") List<Integer> authIdArray); // 根据roleId和authId插入权限信息

}